# Maintainer: Diaz Devera Victor <vitronic2@gmail.com>
pkgname=fcron
pkgver=3.3.1
pkgrel=4
pkgdesc="Periodical command scheduler for systems not always up"
url="http://fcron.free.fr/"
install="fcron.pre-install fcron.post-install fcron.post-upgrade"
options="suid !check"
pkgusers="fcron"
pkggroups="fcron"
arch="all"
license="GPL"
makedepends="readline-dev perl"
subpackages="$pkgname-openrc $pkgname-doc"
source="
	http://fcron.free.fr/archives/fcron-$pkgver.src.tar.gz
	systab.orig
	fcron.initd
	fcron.confd
	"

build() {
	./configure --prefix=/usr \
		--with-editor=/usr/bin/vi \
		--with-spooldir=/var/spool/fcron \
		--sysconfdir=/etc/fcron \
		--with-answer-all=no \
		--with-boot-install=no \
		--localstatedir=/var \
		--with-fifodir=/run \
		--with-piddir=/run \
		--with-sendmail=no \
		--with-selinux=no \
		--with-systemdsystemunitdir=no
	make
}

package() {
	make DESTDIR="$pkgdir/" install
	install -Dm755 "$srcdir"/fcron.initd "$pkgdir"/etc/init.d/fcron
	install -Dm644 "$srcdir"/fcron.confd "$pkgdir"/etc/conf.d/fcron
	#for some reason it man/fr is not compressed, for that reason I erase
	rm -r "$pkgdir"/usr/share/man/fr
	install -Dm640 "$srcdir/systab.orig" "$pkgdir/var/spool/fcron/systab.orig"
}

sha512sums="
b9c5066bdf8588a6b8d811ccc0d49f1d41a17dabf898a280997a8136dc449c2a505c46868abf732f86184ff0720d51f17442691909acae8fb26edcd180cff281  fcron-3.3.1.src.tar.gz
e0abf7da0a9c1c2a8791f9f5b8cdb99260ac3bc49b0e4906ec3fb0d3344f8fe3819a7a80b1bc7b463fe4bc4499686e84ebb33aef9a0ec2298855b06340723e43  systab.orig
5b09016e3387f03978ff970cb252e7b405aa09582435d71bb5c3e6cd9cf9f0ab109c8657d68a884e143f5692e8adefb6c1beea3117390449b8c5db7ac72c2852  fcron.initd
543f77d4613cd848369a4d2ac0f33c5b6991d5a02be2d2d16824b0020bec6d2816c162f3b3aa97530212ac450123eae2f6b2ce3af12c25887187845e9934b004  fcron.confd
"
